package com.adtech.farmProducts.activities.activity;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.TextView;


import com.adtech.common.utils.AccountManagers;
import com.adtech.farmProducts.App;
import com.adtech.farmProducts.R;
import com.adtech.farmProducts.base.BaseActivity;
import com.adtech.farmProducts.base.BaseNfcActivity;
import com.adtech.farmProducts.utils.AppUtil;

import butterknife.BindView;
import butterknife.OnClick;


/**
 * Author:  xiaocz.
 * Descr:  关于
 */
public class AboutActivity extends BaseNfcActivity {

    @BindView(R.id.tv_version)
    public TextView mTVVersion;

    public static void show(Context context) {
        Intent intent = new Intent(context, AboutActivity.class);
        context.startActivity(intent);
    }

    @OnClick({R.id.btn_update_version, R.id.version, R.id.btn_exit})
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_update_version:
                break;
            case R.id.version:
                App.getInstance().showMessage();
                break;
            case R.id.btn_exit:
                AccountManagers.logOut();
                AppUtil.finishAll();
                break;
        }
    }

    @Override
    protected void initData() {
        super.initData();
        mTVVersion.setText(getVersionName());
    }

    @Override
    protected int getLayoutSourceId() {
        return R.layout.activity_about;
    }

}
